# -*- coding: UTF-8 -*-
"""
@Project ：swift-forge-engine 
@File    ：dateclasses
@IDE     ：PyCharm 
@Author  ：Tony
@Date    ：2025/2/20 15:55 
@Des     ：
"""

import dataclasses

from datetime import datetime

from fastapi import Response

from App.utils.enums import StatusType


@dataclasses.dataclass
class IpInfo:
    ip: str
    country: str | None
    region: str | None
    city: str | None


@dataclasses.dataclass
class UserAgentInfo:
    user_agent: str
    os: str | None
    browser: str | None
    device: str | None


@dataclasses.dataclass
class RequestCallNext:
    code: str
    message: str
    status: StatusType
    err: Exception | None
    response: Response


@dataclasses.dataclass
class NewToken:
    new_access_token: str
    new_access_token_expire_time: datetime
    session_uuid: str


@dataclasses.dataclass
class AccessToken:
    access_token: str
    access_token_expire_time: datetime
    session_uuid: str


@dataclasses.dataclass
class RefreshToken:
    refresh_token: str
    refresh_token_expire_time: datetime


@dataclasses.dataclass
class TokenPayload:
    id: int
    session_uuid: str
    expire_time: datetime
